using System;
using System.Collections.Generic;
using System.Text;

namespace Adoor.Mapping.Attributes
{
    [Serializable, AttributeUsage(AttributeTargets.Struct | AttributeTargets.Class, AllowMultiple = true)]
    public class EntityAttribute:BaseAttribute 
    {
        public EntityAttribute():base(0)
        {
        }

        public EntityAttribute(int position)
            : base(position)
        {
        }

        public Type EntityType
        {
            get { return entityType; }
            set { entityType = value; }
        }

        public int ClassId
        {
            get { return classId; }
            set { classId = value; }
        }

        public Type KeyManager
        {
            get { return keyManager; }
            set { keyManager = value; }
        }

        public Type ProviderClass
        {
            get { return providerClass; }
            set { providerClass = value; }
        }

        public string Table
        {
            get { return table; }
            set { table = value; }
        }

        public DictinctMode DictinctMode
        {
            get { return dictinctMode; }
            set { dictinctMode = value; }
        }
                
        //<typing:entity type="Adoor.Domain.Tiers.Lieu, Adoor.Domain.Tiers" classId="100" key_Manager="Adoor.Object.Relational.Suffixkey_Manager, Adoor.Object.Relational"
        //<mapping:entity class="Adoor.Object.Relational.EntityTableFactory, Adoor.Object.Relational" table="Lieu" distinctMode="Emulated">
        private Type entityType = null;
        private int classId = 0;
        private Type keyManager = null;
        private Type providerClass = Type.GetType("Adoor.Object.Relational.EntityTableFactory, Adoor.Object.Relational");
        private string table = string.Empty;
        private DictinctMode dictinctMode = DictinctMode.Emulated;

        public override void AcceptVisitor(IVisitor visitor, System.Reflection.MemberInfo member)
        {
            visitor.Visit(this);  
        }
        
    }
}
